package cn.iocoder.yudao.adminserver.franky.LRU;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @Description:
 * @Author: franky
 * @CreateDate: 2021/4/16 2:19 下午
 * @Version: 1.0
 */
public class SingletonThree {
    private static SingletonThree instance;
    private AtomicLong i = new AtomicLong(0);

    private SingletonThree(){}

    public static SingletonThree getInstance() {
        if (null == instance) {
            synchronized (SingletonThree.class) {
                if (null == instance) {
                    instance = new SingletonThree();
                }
            }
        }
        return instance;
    }

    public long getId() {
        return  i.incrementAndGet();
    }
}
